package com.cgq.pro.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.cgq.base.action.BaseAction;
import com.cgq.pro.service.EcityService;
import com.cgq.utils.GlobalContext;

@Controller
public class EcityAction extends BaseAction {
	@Autowired
	private EcityService ecityService;
	
	public String toList(){
		ecity=ecityService.getCurrentCity();
		return GlobalContext.RESULT_LIST_UI;
	}
	
	/**
	 * 更新当前城市信息
	 */
	public void save(){
		try {
			ecityService.update(ecity);
			ajaxDoneSuccess("更改城市成功!");
		} catch (Exception e) {
			ajaxDoneError("更新失败");
		}
		
	}
}
